.well
  .row
    .col-md-4
      | 零售单号：#{@part_salse.code}    
    .col-md-4
      | 客户姓名：#{@part_salse.customer.name}
    .col-md-4
      | 客户级别：#{@part_salse.customer.customer_level.name}
  .row
    .col-md-4
      | 手机号：#{@part_salse.customer.phone}    
    .col-md-4
      | 车牌号：#{@part_salse.customer.car_num}
    .col-md-4
      | 车型：#{@part_salse.customer.car_mo}
  .row
    .col-md-4
      | 备注：#{@part_salse.note}
    .col-md-4
      | 创建日期：#{@part_salse.created_at.strftime('%Y-%m-%d %H:%M:%S')}
    .col-md-4
      | 创建人：#{@part_salse.user.name}

form method = 'get'
  .panel.panel-default
    .panel-heading
      | 零售配件明细
      = link_to "选择配件" , new_part_salse_detail_path(:id=>@part_salse.id), class: "btn btn-primary btn-xs", style: "margin-left:10px;", :remote=>true

    .panel-body
      .table-responsive
        table.table.table-bordered.table-hover
          tr
            th 配件编号
            th 配件名称
            th 数量
            th 单位
            th 销售单价
            th 小计
            th 操作
          
          -@part_salse.part_salse_details.each do |p|
            tr
              td = p.part.code
              td = p.part.name
              td = p.qty
              td = p.part.unit
              td = p.part.sales_price
              td = p.sub_total
              td
                = link_to "删除" , part_salse_detail_path(:id => p.id), :method => "DELETE", data: {confirm: '一旦删除,将无法恢复,是否删除?'}, class: "btn btn-danger btn-xs"
                
  button type='submit' class="btn btn-success btn-lg btn-block" name='save' 确定